package main

import (
	"fmt"
	"time"
)

func main() {
	a := GetMondayToFirday()
	fmt.Print(a)
	//fmt.Print(time.Now().AddDate(0, 0, 1))
	// a := "jaoighjoaiwhjg,oiajshgio"
	// b := strings.Index(a, ",")
	// a = a[0:b]
	// fmt.Print(a)
}
func GetMonday(t time.Time) string {
	offset := int(time.Monday - t.Weekday())
	if offset > 0 {
		offset = -6
	}
	monday := time.Date(t.Year(), t.Month(), t.Day(), 0, 0, 0, 0, time.Local).AddDate(0, 0, offset)
	return monday.Format("2006-01-02")
}

func GetWeek(t time.Time, w int) string {
	offset := int(time.Monday - t.Weekday())
	if offset > 0 {
		offset = -6
	}
	monday := time.Date(t.Year(), t.Month(), t.Day(), 0, 0, 0, 0, time.Local).AddDate(0, 0, offset+w)
	return monday.Format("2006-01-02")
}
func GetMondayToFirday() [5]string {
	var week [5]string
	for i := 0; i < len(week); i++ {
		week[i] = GetWeek(time.Now(), i)
	}
	return week

}
